package 接口的匿名实现类对象;

public class InterfaceTest {

    public static void main(String[] args) {
        //创建接口的匿名实现类的非匿名对象
        USB phone = new USB() {
            @Override
            public void start() {
                System.out.println(">>>");
            }

            @Override
            public void stop() {
                System.out.println(">>>");
            }
        };

        //创建接口的匿名实现类的匿名对象
        new USB(){
            @Override
            public void start() {
                System.out.println(">>>");
            }

            @Override
            public void stop() {
                System.out.println(">>>");
            }
        };
    }
}

interface USB{

    void start();

    void stop();
}
